#ifndef ParticleVector_H
#define ParticleVector_H
#include "misc.h"
class ParticleVector
{
private:
    double *d;
    int dim;
public:
    ParticleVector();
    ParticleVector(double x,double y,double z,int dim=3);
    ~ParticleVector();
    double getX(){return this->d[0];}
    double getY(){return this->d[1];}
    double getZ(){return this->d[2];}
    void setCoords(double x,double y, double z){d[0]=x; d[1]=y;d[2]=z;}
    void setCoords(double *d){delete this->d;this->d = d;}//delete old coords -> add new coords
    double *getCoords(){return d;};
    double calculateMagnitude(){
        double mag = 0;
        for(int i = 0; i<dim; ++i)
        {
            mag = d[i]*d[i];
        }
        return sqrt(mag);
    }

    ParticleVector* operator+(ParticleVector*);
    ParticleVector* operator+(double*);
    ParticleVector* operator*(ParticleVector*);
    ParticleVector* operator*(double*);
    ParticleVector* operator*(double);

    ParticleVector* scalarMul(double t);
    void vecMul(ParticleVector* vec);
    void addVector(ParticleVector *vec);
};

#endif // ParticleVector_H
